package net.niufei.study.cpatterns.activeobject;

public class MakeRequest implements Request {
	private final Servant servant;
	private final FutureResult result;
	private final int count;
	private final char fillChar;

	public MakeRequest(Servant servant, FutureResult result, int count, char fillChar) {
		this.servant = servant;
		this.result = result;
		this.count = count;
		this.fillChar = fillChar;
	}
	
	@Override
	public void execute() {
		Result result = servant.makeString(count, fillChar);
		this.result.setResult(result);
	}

}
